package yangcheng.first;

public class GeometricObject {
    String color ="white";
    Boolean filled =false;
    public GeometricObject(){

    }
    public GeometricObject(String color,Boolean filled){
        this.color=color;
    }
    public String getColor() {
        return color;
    }
    public void setColor(String color) {
        this.color = color;
    }
    public Boolean isFilled() {
        return filled;
    }
    public void setFilled(Boolean filled) {
        this.filled = filled;
    }
    public String toString(){
        return color;
    }
    public double getArea(){
        double area=0.0;
        return area;
    }
    public double getPerimeter(){
        double perimeter=0.0;
        return perimeter;
    }
}

class Circle{
    double radius;

    public Circle(){

    }
    public Circle(double radius){
        this.radius=radius;
    }
    public Circle(double radius, String color,Boolean filled){
        this.radius=radius;
    }
    public double getRadius() {
        return radius;
    }
    public void setRadius(double radius) {
        this.radius = radius;
    }

    public double getArea() {
        return Math.PI*radius*radius;
    }
    public double getPerimeter() {
        return Math.PI*radius*2;
    }
}

class Rectangle{
    double width;
    double height;

    public Rectangle(){}
    public Rectangle(double width,double height){
        this.width=width;
        this.height=height;
    }
    public Rectangle(double width,double height,String color,Boolean filled){
        this.width=width;
        this.height=height;
    }

    public double getWidth() {
        return width;
    }
    public void setWidth(double width) {
        this.width = width;
    }
    public double getHeight() {
        return height;
    }
    public void setHeight(double height) {
        this.height = height;
    }
    public double getArea() {
        return width*height;
    }
}